package cn.yi.boot.shiro;

import cn.yi.boot.shiro.security.ShiroUtils;
import org.apache.commons.lang3.RandomStringUtils;
import yi.boot.common.security.dto.BaseShiroUser;

public class UserCons {
    public static BaseShiroUser getBaseUser(){
        BaseShiroUser user = new BaseShiroUser();
        user.setUsername("admin");
        user.setIsAdmin(1);
        user.setPassword("123456");
        user.setStatus(1);
        //sha256加密
        String salt = RandomStringUtils.randomAlphanumeric(20);
        user.setSalt(salt);
        user.setPassword(ShiroUtils.sha256(user.getPassword(), user.getSalt()));
        return user;

    }
}
